const fs = require('fs');
const path = require( 'path' );

let pathname = path.resolve( __dirname , 'software' );

let callback = error=>{
    if( error ) {
        console.log( '目录创建失败: ' , error );
        return ;
    }
    console.log( '目录创建成功' );
}

// https://nodejs.org/dist/latest-v16.x/docs/api/fs.html#fsmkdirpath-options-callback
// fs.mkdir( pathname [ , options ] , callback )
let x = fs.mkdir( pathname , callback );
console.log( x );

// 自行测试 mkdirSync 函数
// https://nodejs.org/dist/latest-v16.x/docs/api/fs.html#fsmkdirsyncpath-options
// let x = fs.mkdirSync( pathname [, options] )